1 server_name questionnaires.heureux-cyclage.org formations.heureux-cyclage.org;
3 client_body_buffer_size 8k;
4 client_max_body_size 10m;
6 if ($host = "formations.heureux-cyclage.org") {
7 return 302 "$scheme://questionnaires.heureux-cyclage.org/index.php?r=survey/index/sid/533927/lang/fr";
9 index index.html index.htm index.php;
11 location ~* ^.+.(css|gif|html|ico|jpeg|js|jpg|png|txt|xml)$ {
22 include /etc/nginx/conf.d/fastcgi.conf;
24 if ($request_method !~ ^(GET|HEAD)$) {
25 # NOTE: if non GET/HEAD, don't cache and mark user as uncacheable for 1 second via cookie.
28 if ($no_cache = "1") {
29 # NOTE: drop no cache cookie if need be (for some reason, add_header fails if included in prior if-block).
30 add_header Set-Cookie "_mcnc=1; Max-Age=2; Path=/";
31 add_header X-Microcachable "0";
33 if ($http_cookie ~* "_mcnc") {
34 # NOTE: bypass cache if no-cache cookie is set
37 fastcgi_cache_bypass $no_cache;
38 fastcgi_cache_use_stale updating;
39 fastcgi_cache_valid 200 10s;
40 fastcgi_cache_valid 404 10m;
41 fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
42 fastcgi_index index.php;
43 fastcgi_no_cache $no_cache;
44 fastcgi_param REDIRECT_STATUS 200;
45 # NOTE: PHP only, required if PHP was built with --enable-force-cgi-redirect
46 fastcgi_pass_header Cookie;
47 fastcgi_pass_header Set-Cookie;
48 fastcgi_split_path_info ^(.+\.php)(/.+)$;
50 fastcgi_pass unix:/run/php5/fpm/lhc_quest;